package executable.instance;

public class ClassWithReference {

    private ClassWithReference classWithReference;

    private int value;

    public ClassWithReference getClassWithReference() {
        return classWithReference;
    }

    public void setClassWithReference(ClassWithReference classWithReference) {
        this.classWithReference = classWithReference;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    //////////static

    public static int setAndReadSimple() {
        final ClassWithReference classWithReference1 = new ClassWithReference();

        final ClassWithReference classWithReference2 = new ClassWithReference();
        classWithReference2.setValue(889);

        classWithReference1.setClassWithReference(classWithReference2);
        classWithReference1.setValue(5);

        return classWithReference1.getClassWithReference().getValue();//889
    }

}
